<div id="formStatus">{if isset($error.status)}{$error.status}{/if}</div>
<form method="post" action="?module=website&action=block_TabPageProperties&docId={$page->getUniqueId()}&docLang={$page->getLang()}" name="form">
    <div class="submitButton"><button type="reset" class="greyButton" >{t}Cancel{/t}</button> <button type="submit" name="form[submit]" class="greenButton" >{t}Save{/t}</button></div>
	<input id="withValid" type="hidden" name="form[withValidation]" value="false" />
	<table class="listTable form">
        <tr>
            <td>{t assignTo=iconTitle}Label - The label is the name showed in the admin panel only. It's the page title which is displayed on the website.{/t}{icon name="help.png" class="toolTip" title=$iconTitle}</td>
            <td><label for="label">{t}Label{/t}</label></td>
            <td><input id="label" name="form[label]" type="text" value="{$formValues.label|escape:"html":"UTF-8"}" style="width:300px;" />{if isset($error.label)} {icon name="warning.png"} {$error.label}{/if}</td>
        </tr>
        <tr>
            <td>{t assignTo=iconTitle}URL - Type here the page URL. URL has to be unique for the website.{/t}{icon name="help.png" class="toolTip" title=$iconTitle}</td>
            <td><label for="url">{t}URL{/t}</label></td><td>http://{$page->getWebsiteUrl()}/<input id="url" type="text" name="form[url]" value="{$formValues.url|escape:"html"}" style="width:300px;"/>{if isset($error.url) && $error.url != "copy"} {icon name="warning.png"} {$error.url}{/if}</td>
        </tr>
        {if $error.url == 'copy'}
        <tr>
            <td></td>
            <td></td>
            <td>{icon name="warning.png} {t}Be careful, a page with the same URL is already published.{/t}<br /><input type="checkbox" name="form[forceSwitch]" /> {t}Force replacement of the{/t} <a href="{$URL_RELATIVE}{$pageToSwitch->getUrl()}" target="_blank">{t}page{/t} "{$pageToSwitch->getLabel()}"</a> {t}by this current one.{/t}</td>
        </tr>
        {/if}
        <tr>
            <td>{t assignTo=iconTitle}Layout - You can select another page layout for your page here.{/t}{icon name="help.png" class="toolTip" title=$iconTitle}</td>
            <td><label for="label">{t}Layout{/t}</label></td>
            <td>
                <select name="form[template]">
                    {foreach from=$templates item=template}
                    <option value="{$template.fileName}" {if isset($tmpPage) && $template.fileName==$tmpPage->getParentTemplate()}selected="selected"{/if}>{$template.label}</option>
                    {/foreach}
                </select>
            </td>
        </tr>
        <tr><th colspan="3">{t}Visibility{/t}</th></tr>
        {hasRight rule="website_TabPageProperties"}
        <tr>
            <td>{t assignTo=iconTitle}Rights - Rights defined users or groups allowed to view the page on the website.{/t}{icon name="help.png" class="toolTip" title=$iconTitle}</td>
            <td>{t}Access rights{/t}</td>
            <td>{t assignTo=iconTitle}right{/t}{icon name="user.png" alt=$iconTitle} <a href="{$URL_RELATIVE}/bo/#/website/pageRight/{$page->getLang()}/{$page->getUniqueId()}" class="smallGreyButton nyroModal" >{t}Manage access rights{/t}</a>{if $page->getRight() != ""} - {t}rights activated{/t}{/if}</td>
        </tr>
        {/hasRight}
        {if $page->getRight() != ""}
        <tr><td>{t assignTo=iconTitle}Permissions - Users or groups list allowed to view the page.{/t}{icon name="help.png" class="toolTip" title=$iconTitle}</td><td>{t}Allowed user(s) / group(s){/t}</td><td>
                {foreach from=$users item=user}
                    &bull; {$user->getLabel()}<br />
                {/foreach}
            </td></tr>
        <tr>
            <td>{t assignTo=iconTitle}Forbidden access page - Defined the page to display when an user attempting to view the page without rights. The index page is the default.{/t}{icon name="help.png" class="toolTip" title=$iconTitle}</td>
            <td><label for="page401">{t}"Forbidden access" page{/t} :</label></td>
            <td>
                {if count($errorPages) > 0}
                <select id="page401" name="form[page401]">
                    <option value="">---</option>
                {foreach from=$errorPages item=errorPage}
                    {if $errorPage->isPublished()}
                    <option value="{$errorPage->getUniqueId()}" {if $page->getPage401() == $errorPage->getUniqueId()}selected="selected"{/if}>{$errorPage}</option>
                    {/if}
                {/foreach}
                </select>
                {else}
                    {t}You have to target at least one 401 page to be able to display a specific page, when her access is forbidden.{/t}
                {/if}
            </td>
        </tr>
        {/if}
        <tr><td>{t assignTo=iconTitle}Visibility - This option define if the page have to be listed in the menus or not. An undisplayed page could be the menu index page for example.{/t}{icon name="help.png" class="toolTip" title=$iconTitle}</td><td><label for="menuVisibility">{t}Visible in the menus{/t}</label></td><td><select id="menuVisibility" name="form[visibleInMenu]" ><option value="0">{t}No{/t}</option><option value="1" {if $formValues.visibleInMenu == true} selected="selected"{/if}>{t}Yes{/t}</option></select></td></tr>
        <tr>
            <td>{t assignTo=iconTitle}Site map - This option define if the page is listed in the site map or not.{/t}{icon name="help.png" class="toolTip" title=$iconTitle}</td>
            <td><label for="inSiteMap">{t}Visible in the site map{/t}</label></td>
            <td><select id="inSiteMap" name="form[inSiteMap]"><option value="0">{t}No{/t}</option><option value="1" {if $formValues.inSiteMap == true} selected="selected"{/if}>{t}Yes{/t}</option></select></td>
        </tr>
        <tr>
            <td>{t assignTo=iconTitle}Indexable - This option define if the page must be indexed by pagizer's search engine.{/t}{icon name="help.png" class="toolTip" title=$iconTitle}</td>
            <td><label for="isIndexable">{t}Is indexable{/t}</label></td>
            <td><select id="isIndexable" name="form[isIndexable]"><option value="0">{t}No{/t}</option><option value="1" {if $formValues.isIndexable == true} selected="selected"{/if}>{t}Yes{/t}</option></select></td>
        </tr>
        <tr>
            <td>{t assignTo=iconTitle}Menu entitled - It is the text used in the menu to create the link.{/t}{icon name="help.png" class="toolTip" title=$iconTitle}</td>
            <td><label for="menuLabel">{t}Menu entitled{/t}</label></td>
            <td><input id="menuLabel" name="form[menuLabel]" type="text" value="{$formValues.menuLabel|escape:"html":"UTF-8"}" style="width:300px;"/>{if isset($error.menuLabel)} {icon name="warning.png"} {$error.menuLabel}{/if}</td>
        </tr>
        <tr>
            <td>{t assignTo=iconTitle}Hovering entitled - Hovering entitled is the text displayed when a user mouse over a button.{/t}{icon name="help.png" class="toolTip" title=$iconTitle}</td>
            <td><label for="menuHoverLabel">{t}Menu hovering entitled{/t}</label></td>
            <td><input id="menuHoverLabel" name="form[menuHoverLabel]" type="text" value="{$formValues.menuHoverLabel|escape:"html":"UTF-8"}" style="width:300px;" />{if isset($error.menuHoverLabel)} {icon name="warning.png"} {$error.menuHoverLabel}{/if}</td>
        </tr>
        <tr><th colspan="3">{t}Meta tags and title{/t}</th></tr>
        <tr>
            <td>{t assignTo=iconTitle}Page title - The page title is displayed in browser bar.{/t}{icon name="help.png" class="toolTip" title=$iconTitle}</td>
            <td><label for="metaTitle">{t}Page title{/t}</label></td>
            <td><input id="metaTitle" name="form[metaTitle]" type="text" value="{$formValues.metaTitle|escape:"html":"UTF-8"}" style="width:500px;"/>{if isset($error.metatitle)} {icon name="warning.png"} {$error.metatitle}{/if}</td>
        </tr>
        <tr>
            <td>{t assignTo=iconTitle}Keywords - There are used for SEO, type the page keywords seperated by a comma.{/t}{icon name="help.png" class="toolTip" title=$iconTitle}</td>
            <td><label for="metaKeywords">{t}Keywords{/t}</label></td>
            <td><input id="metaKeywords" type="text" name="form[metaKeywords]" value="{$formValues.metaKeywords|escape:"html":"UTF-8"}" style="width:500px;" /></td>
        </tr>
        <tr>
            <td>{t assignTo=iconTitle}Description - The description is used for SEO, be specific.{/t}{icon name="help.png" class="toolTip" title=$iconTitle}</td>
            <td><label for="metaDescription">{t}Description{/t}</label></td>
            <td><input id="metaDescription" type="text" name="form[metaDescription]" value="{$formValues.metaDescription|escape:"html":"UTF-8"}" style="width:500px;"/></td>
        </tr>
        <tr><th colspan="3">{t}Information{/t}</th></tr>
        <tr><td></td><td>{t}Id{/t}</td><td>{$page->getUniqueId()}</td></tr>
        <tr><td></td><td>{t}Language{/t}</td><td>{$page->getLang()}</td></tr>
        <tr><td></td><td>{t}Page layout{/t}</td><td>{if $page->hasTemplateFile()}{$page->getTemplateLabel()} ( {$page->getTemplate()} ){else}{t}Template file not found{/t} : {$page->getTemplate()}.xml{/if}</tr>
        <tr>
            <td></td>
            <td>{t}Affected target(s){/t}</td>
            <td>
                {assign var='targets' value=$page->getDocumentTargets()}
                {if count($targets) > 0}
                    {foreach from=$targets key=k item=target}
                        {if $k >= 1} / {/if}{$target.label}
                    {/foreach}
                {else}
                /
                {/if}
            </td>
        </tr>
        <tr><td></td><td>{t}Last modification{/t}</td><td>{date date=$page->getTempModificationDate()} {t}by{/t} {$page->getAuthor()|fullname}</td></tr>
        <tr><td></td><td>{t}Creation date{/t}</td><td>{date date=$page->getCreationDate()}</td></tr>
	</table>
</form>